<%@ page contentType="text/html; charset=GBK" %><%@ page import="java.util.*" %><%@ page import="com.ionglobal.db.*" %><%@ page import="com.ionglobal.lib.*" %><%@ page import="com.ionglobal.misc.*" %><%@ page import="com.dhec.ggs.*"%><%@ include file="/inc/config.jsp" %><%
DBI dbi = new DBI();
Request Request = new Request(request);
try{
	int objectId = Request.getInt("id");
	int issueType = Request.getInt("issueType");
	int type = Request.getInt("type");
	Sysop me = (Sysop)session.getAttribute("sysop");
	String code = type==0?issueType==0?" and sIssueCode like 'PTM-2%'":" and sIssueCode like 'PTM-5%'":"";
	int iid=0;
	int count=1;
	//dbi.execQuery("select max(iid) from ggs_DownLoad");
	//if(dbi.rsNext()){
	   //iid=dbi.rsGetInt(1)+1;
	//}
	//dbi.rsClose();
	//String sql="insert into ggs_DownLoad (iId,iobjectid,icount,itype,iissueType,DCrDate,sCrUser) values("+iid+","+objectId+","+count+","+type+","+issueType+","+dbi.getInsertDate(new Date())+",'"+sysop.getName()+"')";
	String sql = "update ggs_Download set iDownload=1,dDownloadDate="+dbi.getCurrentDateTime()+",sDownloadUser='"+sysop.getName()+"' where iObjectId="+objectId+" and iDownload<>1 and SDEPARTMENT='"+me.getDepartName()+"' and iType="+type+code;
dbi.execute(sql);
}catch(Exception e){
	e.printStackTrace();
}finally{
	dbi.closeAll();	
}
%><script>
	self.location='dcnIssueList.jsp';
</script>